1. Field of Invention
The present invention relates to a virtual machine (VM), in particular, to a scheduler of a VM module, a scheduling method thereof, and a device containing computer software for executing the same.
2. Related Art
Virtual machine (VM) is a technique that simulates a plurality of virtual hardware devices on a single hardware platform, so as to run a plurality of operating systems on the hardware platform.
FIG. 1 is a schematic view of a conventional VM system. Referring to FIG. 1, the VM 5 is applied to a hardware platform 6. The core of the VM 5 is a software layer called virtual machine monitor (VMM). The VMM 50 simulates each guest operating system (GOS) 501 run on a virtual hardware device 502 and each application software 503 run on the GOS 501, monitors the operating status of each GOS 501, and allocates the hardware resource on the hardware platform 6 to VM 5.
The key part of the VMM 50 is a VM scheduler (not shown) mainly for determining how to allocate the processor resource of the hardware platform 6 among the VMs 5. Therefore, the design of the scheduler directly affects the execution efficiency of the applications on hardware platform 6 as well as the reaction time and input/output (I/O) performance of the VM 5.
The scheduler of the conventional VM 5 lays emphasis on how to equally allocate the processor resource of the hardware platform 6 and ensure that the processor resource is uniformly allocated to each VM 5. However, the scheduler of the conventional VM 5 fails to solve the problem that I/O devices on the hardware platform 6 are unable to support the operations of a plurality of VMs 5 in a real-time operation environment, such that the reaction time and I/O performance of the VM 5 are undesired.
The reason why the I/O device of the hardware platform 6 in the environment of the VM 5 has a low performance is that the current I/O device is mostly interrupt-driven I/O. When the I/O device sends an interrupt request (IRQ) message, in the environment of the VM 5, the IRQ message cannot be immediately processed, as the processor resource of the hardware platform 6 is shared by a plurality of VMs 5. Only when the VM 5 intending to receive the IRQ message obtains the right to use the processor resource, the IRQ message is received. Therefore, in the environment of the VM 5, all the I/O operations in the interrupt-driven I/O mode are forced to go through an additional delay time, such that the reaction time of the VM 5 is prolonged and the I/O performance of the VM 5 is lowered.
Further, the duration of the delay time is mainly determined by the scheduler mechanism of the VM 5, and the conventional design makes the delay time extended with the increase of the number of the VM 5, such that it is impossible to maintain the quality of real-time services in the environment of the VM 5.